<%-- 
    Document   : city
    Created on : Apr 16, 2012, 4:40:01 PM
    Author     : prateekpatil
--%>

<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="cs425proj.model.*"%>
<%
String movie=request.getParameter("count");
 String buffer="<select name='city' id='city'><option value='-1'>Date</option>";  
   scheduleDetail obj = new scheduleDetail();
   ArrayList<Long> dateList = obj.getDateList(movie);
   ArrayList<Date> displayDate = new ArrayList<Date>();
   long milliSecInDay = (24*60*60*1000);
   long currTime = dateList.get(0);
   long endTime = dateList.get(1);
   while(currTime<=endTime)
             {
                displayDate.add(new Date(currTime));
                currTime+=milliSecInDay;
            }
   SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
   for(int i=0;i<displayDate.size();i++){
       Date dDate = (Date)displayDate.get(i);
       String ds= dateFormat.format(dDate);
   buffer=buffer+"<option value='"+ds+"'>"+ds+"</option>";  
   }  
 buffer=buffer+"</select>";  
 response.getWriter().println(buffer); 
 
  String buffer1="<select name='theater' id='theater'><option value='-1'>Theater</option>";  
  theaterDetail obj1 = new theaterDetail();
  ArrayList<String> theaterList = obj1.getTheaterList("Spider");
   for(int j=0;j<theaterList.size();j++){
   buffer1=buffer1+"<option value='"+theaterList.get(j) +"'>"+theaterList.get(j)+"</option>";  
   }  
 buffer1=buffer1+"</select>";  
 response.getWriter().println(buffer1); 
 
 String buffer2="<select name='showtime' id='showtime'><option value='-1'>Time</option>";  
buffer2=buffer2+"<option value='12:00'>12:00</option>"+"<option value='15:00'>15:00</option>"+"<option value='18:00'>18:00</option>"+"<option value='21:00'>21:00</option>";  
 buffer2=buffer2+"</select>";  
 response.getWriter().println(buffer2); 
 



 %>
